// run: $exec < input
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>

int const  inf = 1 << 28;
int const maxn = 200;
int a[maxn];
int f[maxn][3]; // 0 for rest, 1 for sport, 2 for contest
int n;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n;
	for (int i = 1; i <= n; i++) std::cin >> a[i];
	for (int i = 0; i <= n; i++)
		for (int j = 0; j < 3; j++) f[i][j] = inf;
	f[0][0] = 0;
	for (int i = 1; i <= n; i++) {
		if (a[i] == 0) {
			f[i][0] = std::min(f[i - 1][0], std::min(f[i - 1][1], f[i - 1][2])) + 1;
		} else if (a[i] == 1) {
			f[i][0] = std::min(f[i - 1][0], std::min(f[i - 1][1], f[i - 1][2])) + 1;
			f[i][2] = std::min(f[i - 1][0], f[i - 1][1]);
		} else if (a[i] == 2) {
			f[i][0] = std::min(f[i - 1][0], std::min(f[i - 1][1], f[i - 1][2])) + 1;
			f[i][1] = std::min(f[i - 1][0], f[i - 1][2]);
		} else {
			f[i][0] = std::min(f[i - 1][0], std::min(f[i - 1][1], f[i - 1][2])) + 1;
			f[i][1] = std::min(f[i - 1][0], f[i - 1][2]);
			f[i][2] = std::min(f[i - 1][0], f[i - 1][1]);
		}
	}
	std::cout << std::min(f[n][0], std::min(f[n][1], f[n][2])) << "\n";
}

